package com.tangyuan.template;

public class Parent {

    protected void doAnything(){}
    protected void doSomething(){}
    public void templateMethod(){
         //调用基本方法，完成相关的逻辑
        this.doAnything();
        this.doSomething();
    }

    public static void main(String[] args) {
        Parent abstractClass= new ConcreteClass1();
        abstractClass.templateMethod();
    }
}
